package com.zhuzi.guicollect;

import com.zhuzi.guicollect.config.DemoSplash;
import com.zhuzi.guicollect.ui.TabView;
import de.felixroske.jfxsupport.AbstractJavaFxApplicationSupport;
import de.felixroske.jfxsupport.GUIState;
import javafx.application.ConditionalFeature;
import javafx.application.Platform;
import javafx.stage.Stage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class Main extends AbstractJavaFxApplicationSupport {


    public static void main(String[] args) {
        launch(Main.class, TabView.class, new DemoSplash(), args);
        // launch(Main.class, FnvshenView.class, new DemoSplash(), args);
    }

    @Autowired
    ConfigurableApplicationContext applicationContext;

    @Override
    public void beforeInitialView(Stage stage, ConfigurableApplicationContext ctx) {
        System.out.println("平台可用么" + Platform.isSupported(ConditionalFeature.INPUT_METHOD));
        super.beforeInitialView(stage, ctx);
    }

    public static void sysShowView(Class classs) {
        Stage stage = GUIState.getStage();
        stage.close();
        Main.showView(classs);
    }
}
